﻿using Bouyei.GeoCore.Converters;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Bouyei.GeoCore.GeoParsers.GeoJson
{
    public class GeometryReader:BaseString
    {
        public GeometryReader(string jsonString)
        :base(jsonString){ }

        public FeatureCollection<proT, geoT> FromReaderToFeatureCollection<proT, geoT>()
        {
            return new JsonExtensions().ConvertTo<FeatureCollection<proT, geoT>>(Content);
        }

        public Feature<proT, geoT> FromReaderToFeature<proT, geoT>()
        {
            return new JsonExtensions().ConvertTo<Feature<proT, geoT>>(Content);
        }

        public GeometryCollection<geoT> FromReaderToGeometryCollection<geoT>()
        {
            return new JsonExtensions().ConvertTo<GeometryCollection<geoT>>(Content);
        }
    }
}
